package com.wande.dataplatform.domain.bo;

import com.wande.common.core.validate.AddGroup;
import com.wande.common.core.validate.EditGroup;
import com.wande.common.mybatis.core.domain.BaseEntity;
import com.wande.dataplatform.domain.DataSource;
import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 数据源业务对象 dp_datasource
 *
 * @author ruoyi
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = DataSource.class, reverseConvertGenerate = false)
public class DataSourceBo extends BaseEntity {

    /**
     * 数据源ID
     */
    @NotNull(message = "数据源ID不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 数据源名称
     */
    @NotBlank(message = "数据源名称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String name;

    /**
     * 数据源类型
     */
    @NotBlank(message = "数据源类型不能为空", groups = { AddGroup.class, EditGroup.class })
    private String type;

    /**
     * 主机地址
     */
    private String host;

    /**
     * 端口
     */
    private Integer port;

    /**
     * 数据库名
     */
    private String databaseName;

    /**
     * 用户名
     */
    private String username;

    /**
     * 密码
     */
    private String password;

    /**
     * 扩展属性(JSON)
     */
    private String properties;

    /**
     * 状态(0-禁用 1-启用)
     */
    private Integer status;

    /**
     * 项目ID
     */
    private Long projectId;

    /**
     * 备注
     */
    private String remark;

}
